package com.zdx.yswl.ui.bean;

import java.util.ArrayList;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public class ConsultantBean extends BaseBean{
	private static final long serialVersionUID = 130309477853872845L;

	public ConsultantBean(String headUrl, String name, int goodCount, String tel) {
		super();
		this.headUrl = headUrl;
		this.name = name;
		this.goodCount = goodCount;
		this.tel = tel;
	}

	public String id; //id
	
	public String headUrl; //头像
	
	public String name; //置业顾问 名字
	
	public int goodCount; //好评数量
	
	public String tel;//电话
	
	public String addTime;//添加时间
	
	public String projectId;//楼盘id
	
	public int status;
	
	
	
	
	public static ArrayList<ConsultantBean> getListBeanFromJSON(JSONArray jsonArr) throws JSONException {
		ArrayList<ConsultantBean> list = new ArrayList<ConsultantBean>();
			int lenth = jsonArr.length();
			if (lenth <= 0  || jsonArr == null) {
				return null;
			}

			for (int i = 0; i < lenth; i++) {
				ConsultantBean bean = new ConsultantBean();
				JSONObject jsonObj = jsonArr.getJSONObject(i);
				bean.id = jsonObj.getString("id");
				bean.headUrl = jsonObj.getString("icon");
				bean.name = jsonObj.getString("name");
				bean.goodCount = jsonObj.getInt("up");
				bean.tel = jsonObj.getString("contact");
				bean.addTime = jsonObj.getString("addTime");
				bean.projectId = jsonObj.getString("projectId");
				bean.status = jsonObj.getInt("status");
				list.add(bean);
			}


		return list;
	}



	public ConsultantBean() {
		super();
	}
}
